import request from '@/utils/request';

// 查询用户列表
export function listUser(query) {
	return request({
		url: '/mall/user/list',
		method: 'post',
		data: query,
	});
}

// 查询用户详细
export function getUser(id) {
	return request({
		url: '/mall/user/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增用户
export function addUser(data) {
	return request({
		url: '/mall/user/add',
		method: 'post',
		data: data,
	});
}

// 编辑用户
export function editUserVipEndTime(data) {
	return request({
		url: '/mall/user/editUserVipEndTime',
		method: 'post',
		data: data,
	});
}

// 编辑用户
export function updateUser(data) {
	return request({
		url: '/mall/user/edit',
		method: 'post',
		data: data,
	});
}

// 删除用户
export function delUser(id) {
	return request({
		url: '/mall/user/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出用户
export function exportUser(query) {
	return request({
		url: '/mall/user/export',
		method: 'post',
		params: query,
	});
}

export function newListUser(data) {
	return request({
		url: '/mall/user/new_user',
		method: 'post',
		data: data,
	});
}
export function getUserInfo(data) {
	return request({
		url: '/mall/user/getInfo',
		method: 'post',
		data: data,
	});
}

export function getGrouplist(data) {
	return request({
		url: '/mall/user/grouplist',
		method: 'post',
		data: data,
	});
}

export function getGroupDownlist(data) {
	return request({
		url: '/mall/user/groupdownlist',
		method: 'post',
		data: data,
	});
}
export function search(data) {
	return request({
		url: '/mall/user/search',
		method: 'get',
		params: data,
	});
}

// 编辑用户
export function editUserStatus(data) {
	return request({
		url: '/mall/user/editUserStatus',
		method: 'post',
		data: data,
	});
}

//统计
export function queryUserStatistics() {
	return request({
		url: '/mall/user/queryUserStatistics',
		method: 'get',
	});
}
